class_name FunctionCard
extends Button

#节点
@onready var label = $Label
@onready var run_detail = $RunDetail
@onready var color_rect = $ColorRect
@onready var self_description_node = $SelfDescription
@onready var self_descrpition_label = $SelfDescription/SelfDescriptionLabel
@onready var button = self
#功能牌属性
@export var card_name:String = "功能牌" # 名字
@export var self_destruction:bool = false # 是否能自动销毁
#触发时机定义
#1-->整个回合开始， 2-->单次出牌结算时， 3-->单次出牌结算整体结束， 4-->整个回合结束
@export var trigger_timing = 1
var cost = 1
var card_id = "Base"
@export var self_description:String = "这是一段描述文字" # 功能介绍

func _ready() -> void:
	pass

#鼠标移入事件
func _on_mouse_entered() -> void:
	self_description_node.visible = true
#鼠标移出事件
func _on_mouse_exited() -> void:
	self_description_node.visible = false

func cardFunction(deck,scoreMapping,selectedCardsDetail):
	#在继承场景内定义具体方法
	pass

func showRunDetail():
	button.modulate = Color(0.8, 1, 0.8)
	self.scale = Vector2(1.1,1.1)
	run_detail.visible = true
	
func hideRunDetail():
	button.modulate = Color(1, 1, 1)
	self.scale = Vector2(1,1)
	run_detail.visible = false
